package com.panasonic.cn.cmsc;

import java.io.*;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.sql.SQLException;
import com.fujitsu.fks.jaaf.core.*;

public class SQLMM0104{
	private Hashtable paramsString     = new Hashtable();
	private Hashtable paramsBigDecimal = new Hashtable();
	private Hashtable paramsFree       = new Hashtable();
	private String lastSql_ = null;

	private String getString(String name){
		if(name==null) return "";
		String returnStr = (String)paramsString.get(name);
		if(returnStr==null) return "";
		return "'"+FrameworkCommon.stringReplaceSQuote(returnStr)+"'";
	}

	private String getBigDecimal(String name){
		if(name==null) return "";
		BigDecimal returnStr = (BigDecimal)paramsBigDecimal.get(name);
		if(returnStr==null) return "";
		return returnStr.toString();
	}

	private String getFree(String name){
		if(name==null) return "";
		String returnStr = (String)paramsFree.get(name);
		if(returnStr==null) return "";
		return returnStr;
	}

	public String getLastSql(){
		return lastSql_;
	}

	public int INSERT_BM0101(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" INSERT INTO BM01(");
		sql.append(" SEQ_NO,");
		sql.append(" VDR_CD,");
		sql.append(" APL_BDT,");
		sql.append(" APL_EDT,");
		sql.append(" GNR_ADM_NO,");
		sql.append(" TMP_AC_TYP ,");
		sql.append(" CTRL_DVSN_CD ,");
		sql.append(" TRPT_CLSS_D_TYP ,");
		sql.append(" CTY_CD,");
		sql.append(" CN_PST_CD,");
		sql.append(" TRPT_ADR_CN,");
		sql.append(" TRPT_NM_CN,");
		sql.append(" TRPT_AB_CN,");
		sql.append(" TEL_NO,");
		sql.append(" FAX_NO,");
		sql.append(" CUS_CLSS_CD,");
		sql.append(" CUS_CLSS_DTL_CD,");
		sql.append(" SLS_CHRG_CD ,");
		sql.append(" SLS_CHNL_CD,");
		sql.append(" SLS_SLS_DEPT,");
		sql.append(" BRNC_CD,");
		sql.append(" SUB_BRNC_CD,");
		sql.append(" SUB_SECT_CD,");
		sql.append(" SLS_CHNL_RGN_CD,");
		sql.append(" STATE_CD,");
		sql.append(" AREA_CD,");
		sql.append(" GRP_CD1,");
		sql.append(" GRP_CD2,");
		sql.append(" GRP_CD3,");
		sql.append(" GRP_CD4,");
		sql.append(" CST_CALLING,");
		sql.append(" SLS_DEST,");
		sql.append(" CORP_CD,");
		sql.append(" CDR_CD,");
		sql.append(" OLD_CUS_CD1,");
		sql.append(" OLD_CUS_CD2,");
		sql.append(" OLD_CUS_CD3,");
		sql.append(" TRD_STP_FLG,");
		sql.append(" RECPT_TYP,");
		sql.append(" STR_ORG_CD,");
		sql.append(" BU_AREA_CD,");
		sql.append(" CORP_CD_SLS,");
		sql.append(" PRIZ_RT_CD,");
		sql.append(" RMK,");
		sql.append(" PMIT_CLNT_CD,");
		sql.append(" DFLT_SHP_DSTN_CD,");
		sql.append(" DSP_ITM_CLNT_TYP,");
		sql.append(" CNSMT_ITM_CLNT_TYP,");
		sql.append(" FRNT_WHRS_CD,");
		sql.append(" BIL_DSTN_CD,");
		sql.append(" CUS_PYMT_PRID,");
		sql.append(" CUS_BNK_CD,");
		sql.append(" CUS_BNK_ACC,");
		sql.append(" CUS_CRDT_LMT_AMT,");
		sql.append(" CUS_ADD_PRIZ_TAX_CD,");
		sql.append(" CUS_ADD_PRIZ_CAL_TYP,");
		sql.append(" CUS_ADD_PRIZ_RGS_NO,");
		sql.append(" CUS_MLT_CRCY,");
		sql.append(" CUS_CRCY_CD,");
		sql.append(" CUS_AR_AC,");
		sql.append(" CUS_PRFT_AC,");
		sql.append(" CUS_TAX_AC,");
		sql.append(" SUP_DEBT_AC,");
		sql.append(" SUP_PRPY_AC,");
		sql.append(" SUP_PRPYFT_AC,");
		sql.append(" SUP_PYMT_PRID,");
		sql.append(" OVS_SUP_TYP,");
		sql.append(" MAIN_STR_TYP,");
		sql.append(" CONS_AC_TYP,");
		sql.append(" DFLT_RCV_DSTN_CD,");
		sql.append(" SITE_NM,");
		sql.append(" SUP_ADD_PRIZ_TAX_CD,");
		sql.append(" CUS_PRC_TAB_CD,");
		sql.append(" RGS_DTTM,");
		sql.append(" RGS_CHRG_CD,");
		sql.append(" RGS_PGID,");
		sql.append(" UPD_DTTM,");
		sql.append(" UPD_CHRG_CD,");
		sql.append(" UPD_PGID,");
		sql.append(" FM_TYP)");
		sql.append(" SELECT");
		sql.append(" SEQ_BM01.NEXTVAL,");
		sql.append(" VDR_CD,");
		sql.append(" APL_BDT,");
		sql.append(" APL_EDT,");
		sql.append(" GNR_ADM_NO,");
		sql.append(" TMP_AC_TYP ,");
		sql.append(" CTRL_DVSN_CD ,");
		sql.append(" TRPT_CLSS_D_TYP ,");
		sql.append(" CTY_CD,");
		sql.append(" CN_PST_CD,");
		sql.append(" TRPT_ADR_CN,");
		sql.append(" TRPT_NM_CN,");
		sql.append(" TRPT_AB_CN,");
		sql.append(" TEL_NO,");
		sql.append(" FAX_NO,");
		sql.append(" CUS_CLSS_CD,");
		sql.append(" CUS_CLSS_DTL_CD,");
		sql.append(" SLS_CHRG_CD ,");
		sql.append(" SLS_CHNL_CD,");
		sql.append(" SLS_SLS_DEPT,");
		sql.append(" BRNC_CD,");
		sql.append(" SUB_BRNC_CD,");
		sql.append(" SUB_SECT_CD,");
		sql.append(" SLS_CHNL_RGN_CD,");
		sql.append(" STATE_CD,");
		sql.append(" AREA_CD,");
		sql.append(" GRP_CD1,");
		sql.append(" GRP_CD2,");
		sql.append(" GRP_CD3,");
		sql.append(" GRP_CD4,");
		sql.append(" CST_CALLING,");
		sql.append(" SLS_DEST,");
		sql.append(" CORP_CD,");
		sql.append(" CDR_CD,");
		sql.append(" OLD_CUS_CD1,");
		sql.append(" OLD_CUS_CD2,");
		sql.append(" OLD_CUS_CD3,");
		sql.append(" TRD_STP_FLG,");
		sql.append(" RECPT_TYP,");
		sql.append(" STR_ORG_CD,");
		sql.append(" BU_AREA_CD,");
		sql.append(" CORP_CD_SLS,");
		sql.append(" PRIZ_RT_CD,");
		sql.append(" RMK,");
		sql.append(" PMIT_CLNT_CD,");
		sql.append(" DFLT_SHP_DSTN_CD,");
		sql.append(" DSP_ITM_CLNT_TYP,");
		sql.append(" CNSMT_ITM_CLNT_TYP,");
		sql.append(" FRNT_WHRS_CD,");
		sql.append(" BIL_DSTN_CD,");
		sql.append(" CUS_PYMT_PRID,");
		sql.append(" CUS_BNK_CD,");
		sql.append(" CUS_BNK_ACC,");
		sql.append(" CUS_CRDT_LMT_AMT,");
		sql.append(" CUS_ADD_PRIZ_TAX_CD,");
		sql.append(" CUS_ADD_PRIZ_CAL_TYP,");
		sql.append(" CUS_ADD_PRIZ_RGS_NO,");
		sql.append(" CUS_MLT_CRCY,");
		sql.append(" CUS_CRCY_CD,");
		sql.append(" CUS_AR_AC,");
		sql.append(" CUS_PRFT_AC,");
		sql.append(" CUS_TAX_AC,");
		sql.append(" SUP_DEBT_AC,");
		sql.append(" SUP_PRPY_AC,");
		sql.append(" SUP_PRPYFT_AC,");
		sql.append(" SUP_PYMT_PRID,");
		sql.append(" OVS_SUP_TYP,");
		sql.append(" MAIN_STR_TYP,");
		sql.append(" CONS_AC_TYP,");
		sql.append(" DFLT_RCV_DSTN_CD,");
		sql.append(" SITE_NM,");
		sql.append(" SUP_ADD_PRIZ_TAX_CD,");
		sql.append(" CUS_PRC_TAB_CD,");
		sql.append(" RGS_DTTM,");
		sql.append(" RGS_CHRG_CD,");
		sql.append(" RGS_PGID,");
		sql.append(" UPD_DTTM,");
		sql.append(" UPD_CHRG_CD,");
		sql.append(" UPD_PGID,");
		sql.append(" FM_TYP");
		sql.append(" FROM");
		sql.append(" M01");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public int INSERT_BM0102(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" INSERT INTO BM01(");
		sql.append(" SEQ_NO,");
		sql.append(" VDR_CD,");
		sql.append(" APL_BDT,");
		sql.append(" APL_EDT,");
		sql.append(" GNR_ADM_NO,");
		sql.append(" TMP_AC_TYP ,");
		sql.append(" CTRL_DVSN_CD ,");
		sql.append(" TRPT_CLSS_D_TYP ,");
		sql.append(" CTY_CD,");
		sql.append(" CN_PST_CD,");
		sql.append(" TRPT_ADR_CN,");
		sql.append(" TRPT_NM_CN,");
		sql.append(" TRPT_AB_CN,");
		sql.append(" TEL_NO,");
		sql.append(" FAX_NO,");
		sql.append(" CUS_CLSS_CD,");
		sql.append(" CUS_CLSS_DTL_CD,");
		sql.append(" SLS_CHRG_CD ,");
		sql.append(" SLS_CHNL_CD,");
		sql.append(" SLS_SLS_DEPT,");
		sql.append(" BRNC_CD,");
		sql.append(" SUB_BRNC_CD,");
		sql.append(" SUB_SECT_CD,");
		sql.append(" SLS_CHNL_RGN_CD,");
		sql.append(" STATE_CD,");
		sql.append(" AREA_CD,");
		sql.append(" GRP_CD1,");
		sql.append(" GRP_CD2,");
		sql.append(" GRP_CD3,");
		sql.append(" GRP_CD4,");
		sql.append(" CST_CALLING,");
		sql.append(" SLS_DEST,");
		sql.append(" CORP_CD,");
		sql.append(" CDR_CD,");
		sql.append(" OLD_CUS_CD1,");
		sql.append(" OLD_CUS_CD2,");
		sql.append(" OLD_CUS_CD3,");
		sql.append(" TRD_STP_FLG,");
		sql.append(" RECPT_TYP,");
		sql.append(" STR_ORG_CD,");
		sql.append(" BU_AREA_CD,");
		sql.append(" CORP_CD_SLS,");
		sql.append(" PRIZ_RT_CD,");
		sql.append(" RMK,");
		sql.append(" PMIT_CLNT_CD,");
		sql.append(" DFLT_SHP_DSTN_CD,");
		sql.append(" DSP_ITM_CLNT_TYP,");
		sql.append(" CNSMT_ITM_CLNT_TYP,");
		sql.append(" FRNT_WHRS_CD,");
		sql.append(" BIL_DSTN_CD,");
		sql.append(" CUS_PYMT_PRID,");
		sql.append(" CUS_BNK_CD,");
		sql.append(" CUS_BNK_ACC,");
		sql.append(" CUS_CRDT_LMT_AMT,");
		sql.append(" CUS_ADD_PRIZ_TAX_CD,");
		sql.append(" CUS_ADD_PRIZ_CAL_TYP,");
		sql.append(" CUS_ADD_PRIZ_RGS_NO,");
		sql.append(" CUS_MLT_CRCY,");
		sql.append(" CUS_CRCY_CD,");
		sql.append(" CUS_AR_AC,");
		sql.append(" CUS_PRFT_AC,");
		sql.append(" CUS_TAX_AC,");
		sql.append(" SUP_DEBT_AC,");
		sql.append(" SUP_PRPY_AC,");
		sql.append(" SUP_PRPYFT_AC,");
		sql.append(" SUP_PYMT_PRID,");
		sql.append(" OVS_SUP_TYP,");
		sql.append(" MAIN_STR_TYP,");
		sql.append(" CONS_AC_TYP,");
		sql.append(" DFLT_RCV_DSTN_CD,");
		sql.append(" SITE_NM,");
		sql.append(" SUP_ADD_PRIZ_TAX_CD,");
		sql.append(" CUS_PRC_TAB_CD,");
		sql.append(" RGS_DTTM,");
		sql.append(" RGS_CHRG_CD,");
		sql.append(" RGS_PGID,");
		sql.append(" UPD_DTTM,");
		sql.append(" UPD_CHRG_CD,");
		sql.append(" UPD_PGID,");
		sql.append(" FM_TYP)");
		sql.append(" SELECT");
		sql.append(" SEQ_BM01.NEXTVAL,");
		sql.append(" VDR_CD,");
		sql.append(" APL_BDT,");
		sql.append(" APL_EDT,");
		sql.append(" GNR_ADM_NO,");
		sql.append(" TMP_AC_TYP ,");
		sql.append(" CTRL_DVSN_CD ,");
		sql.append(" TRPT_CLSS_D_TYP ,");
		sql.append(" CTY_CD,");
		sql.append(" CN_PST_CD,");
		sql.append(" TRPT_ADR_CN,");
		sql.append(" TRPT_NM_CN,");
		sql.append(" TRPT_AB_CN,");
		sql.append(" TEL_NO,");
		sql.append(" FAX_NO,");
		sql.append(" CUS_CLSS_CD,");
		sql.append(" CUS_CLSS_DTL_CD,");
		sql.append(" SLS_CHRG_CD ,");
		sql.append(" SLS_CHNL_CD,");
		sql.append(" SLS_SLS_DEPT,");
		sql.append(" BRNC_CD,");
		sql.append(" SUB_BRNC_CD,");
		sql.append(" SUB_SECT_CD,");
		sql.append(" SLS_CHNL_RGN_CD,");
		sql.append(" STATE_CD,");
		sql.append(" AREA_CD,");
		sql.append(" GRP_CD1,");
		sql.append(" GRP_CD2,");
		sql.append(" GRP_CD3,");
		sql.append(" GRP_CD4,");
		sql.append(" CST_CALLING,");
		sql.append(" SLS_DEST,");
		sql.append(" CORP_CD,");
		sql.append(" CDR_CD,");
		sql.append(" OLD_CUS_CD1,");
		sql.append(" OLD_CUS_CD2,");
		sql.append(" OLD_CUS_CD3,");
		sql.append(" TRD_STP_FLG,");
		sql.append(" RECPT_TYP,");
		sql.append(" STR_ORG_CD,");
		sql.append(" BU_AREA_CD,");
		sql.append(" CORP_CD_SLS,");
		sql.append(" PRIZ_RT_CD,");
		sql.append(" RMK,");
		sql.append(" PMIT_CLNT_CD,");
		sql.append(" DFLT_SHP_DSTN_CD,");
		sql.append(" DSP_ITM_CLNT_TYP,");
		sql.append(" CNSMT_ITM_CLNT_TYP,");
		sql.append(" FRNT_WHRS_CD,");
		sql.append(" BIL_DSTN_CD,");
		sql.append(" CUS_PYMT_PRID,");
		sql.append(" CUS_BNK_CD,");
		sql.append(" CUS_BNK_ACC,");
		sql.append(" CUS_CRDT_LMT_AMT,");
		sql.append(" CUS_ADD_PRIZ_TAX_CD,");
		sql.append(" CUS_ADD_PRIZ_CAL_TYP,");
		sql.append(" CUS_ADD_PRIZ_RGS_NO,");
		sql.append(" CUS_MLT_CRCY,");
		sql.append(" CUS_CRCY_CD,");
		sql.append(" CUS_AR_AC,");
		sql.append(" CUS_PRFT_AC,");
		sql.append(" CUS_TAX_AC,");
		sql.append(" SUP_DEBT_AC,");
		sql.append(" SUP_PRPY_AC,");
		sql.append(" SUP_PRPYFT_AC,");
		sql.append(" SUP_PYMT_PRID,");
		sql.append(" OVS_SUP_TYP,");
		sql.append(" MAIN_STR_TYP,");
		sql.append(" CONS_AC_TYP,");
		sql.append(" DFLT_RCV_DSTN_CD,");
		sql.append(" SITE_NM,");
		sql.append(" SUP_ADD_PRIZ_TAX_CD,");
		sql.append(" CUS_PRC_TAB_CD,");
		sql.append(" RGS_DTTM,");
		sql.append(" RGS_CHRG_CD,");
		sql.append(" RGS_PGID,");
		sql.append(" UPD_DTTM,");
		sql.append(" UPD_CHRG_CD,");
		sql.append(" UPD_PGID,");
		sql.append(" FM_TYP");
		sql.append(" FROM");
		sql.append(" M01");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_EDT >"+((getString("NOWDATE").equals(""))?" is null ":"=")+getString("NOWDATE")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public int DELETE_M0102(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" UPDATE");
		sql.append(" M01");
		sql.append(" SET");
		sql.append(" APL_EDT = TO_CHAR((TO_DATE(APL_BDT,'YYYYMMDD') - 1),'YYYYMMDD')");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public int DELETE_M0103(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" DELETE");
		sql.append(" M01");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public int DELETE_M0104(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" DELETE");
		sql.append(" M01");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT = (");
		sql.append(" SELECT MIN(APL_BDT) AS APL_BDT");
		sql.append(" FROM");
		sql.append(" M01");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("FM_TYP")+"");
		sql.append(" )");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public SelectResultRset SELECT_M0191(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT");
		sql.append(" APL_EDT,");
		sql.append(" UPD_DTTM");
		sql.append(" FROM");
		sql.append(" M01");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public int UPDATE_M0192(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" UPDATE M01");
		sql.append(" SET");
		sql.append(" APL_EDT "+((getString("APL_EDT").equals(""))?" is null ":"=")+getString("APL_EDT")+",");
		sql.append(" UPD_DTTM = TO_DATE("+getString("UPD_DTTM")+",'YYYYMMDDHH24MISS'),");
		sql.append(" UPD_CHRG_CD "+((getString("UPD_CHRG_CD").equals(""))?" is null ":"=")+getString("UPD_CHRG_CD")+",");
		sql.append(" UPD_PGID "+((getString("UPD_PGID").equals(""))?" is null ":"=")+getString("UPD_PGID")+",");
		sql.append(" FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+"");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public int UPDATE_M0193(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" UPDATE M01");
		sql.append(" SET");
		sql.append(" APL_EDT "+((getString("APL_EDT").equals(""))?" is null ":"=")+getString("APL_EDT")+",");
		sql.append(" UPD_DTTM = TO_DATE("+getString("UPD_DTTM")+",'YYYYMMDDHH24MISS'),");
		sql.append(" UPD_CHRG_CD "+((getString("UPD_CHRG_CD").equals(""))?" is null ":"=")+getString("UPD_CHRG_CD")+",");
		sql.append(" UPD_PGID "+((getString("UPD_PGID").equals(""))?" is null ":"=")+getString("UPD_PGID")+",");
		sql.append(" FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+"");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public int UPDATE_M0194(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" UPDATE M01");
		sql.append(" SET");
		sql.append(" UPD_DTTM = TO_DATE("+getString("UPD_DTTM")+",'YYYYMMDDHH24MISS'),");
		sql.append(" UPD_CHRG_CD "+((getString("UPD_CHRG_CD").equals(""))?" is null ":"=")+getString("UPD_CHRG_CD")+",");
		sql.append(" UPD_PGID "+((getString("UPD_PGID").equals(""))?" is null ":"=")+getString("UPD_PGID")+",");
		sql.append(" FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+"");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public int UPDATE_M0195(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" UPDATE M01");
		sql.append(" SET");
		sql.append(" APL_EDT "+((getString("APL_EDT").equals(""))?" is null ":"=")+getString("APL_EDT")+",");
		sql.append(" UPD_DTTM = TO_DATE("+getString("UPD_DTTM")+",'YYYYMMDDHH24MISS'),");
		sql.append(" UPD_CHRG_CD "+((getString("UPD_CHRG_CD").equals(""))?" is null ":"=")+getString("UPD_CHRG_CD")+",");
		sql.append(" UPD_PGID "+((getString("UPD_PGID").equals(""))?" is null ":"=")+getString("UPD_PGID")+",");
		sql.append(" FM_TYP "+((getString("FM_TYP").equals(""))?" is null ":"=")+getString("FM_TYP")+"");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT <"+((getString("SYSDATE").equals(""))?" is null ":"=")+getString("SYSDATE")+"");
		sql.append(" AND");
		sql.append(" APL_EDT >"+((getString("SYSDATE").equals(""))?" is null ":"=")+getString("SYSDATE")+"");
		sql.append(" AND FM_TYP <> '6'");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		int updateCount = db.executeUpdate();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return updateCount;
	}

	public SelectResultRset SELECT_M0105(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT");
		sql.append(" NVL(VDR_CD,'') AS VDR_CD,");
		sql.append(" NVL(APL_BDT,'') AS APL_BDT,");
		sql.append(" NVL(APL_EDT,'') AS APL_EDT,");
		sql.append(" NVL(GNR_ADM_NO,'') AS GNR_ADM_NO,");
		sql.append(" NVL(TMP_AC_TYP,'') AS TMP_AC_TYP,");
		sql.append(" NVL(CTRL_DVSN_CD,'') AS CTRL_DVSN_CD,");
		sql.append(" NVL(TRPT_CLSS_D_TYP,'') AS TRPT_CLSS_D_TYP,");
		sql.append(" NVL(CTY_CD,'') AS CTY_CD,");
		sql.append(" NVL(CN_PST_CD,'') AS CN_PST_CD,");
		sql.append(" NVL(TRPT_ADR_CN,'') AS TRPT_ADR_CN,");
		sql.append(" NVL(TRPT_NM_CN,'') AS TRPT_NM_CN,");
		sql.append(" NVL(TRPT_AB_CN,'') AS TRPT_AB_CN,");
		sql.append(" NVL(TEL_NO,'') AS TEL_NO,");
		sql.append(" NVL(FAX_NO,'') AS FAX_NO,");
		sql.append(" NVL(CUS_CLSS_CD,'') AS CUS_CLSS_CD,");
		sql.append(" NVL(CUS_CLSS_DTL_CD,'') AS CUS_CLSS_DTL_CD,");
		sql.append(" NVL(SLS_CHRG_CD,'') AS SLS_CHRG_CD,");
		sql.append(" NVL(SLS_CHNL_CD,'') AS SLS_CHNL_CD,");
		sql.append(" NVL(SLS_SLS_DEPT,'') AS SLS_SLS_DEPT,");
		sql.append(" NVL(BRNC_CD,'') AS BRNC_CD,");
		sql.append(" NVL(SUB_BRNC_CD,'') AS SUB_BRNC_CD,");
		sql.append(" NVL(SUB_SECT_CD,'') AS SUB_SECT_CD,");
		sql.append(" NVL(SLS_CHNL_RGN_CD,'') AS RGN_CD,");
		sql.append(" NVL(STATE_CD,'') AS STATE_CD,");
		sql.append(" NVL(AREA_CD,'') AS AREA_CD,");
		sql.append(" NVL(GRP_CD1,'') AS GRP_CD1,");
		sql.append(" NVL(GRP_CD2,'') AS GRP_CD2,");
		sql.append(" NVL(GRP_CD3,'') AS GRP_CD3,");
		sql.append(" NVL(GRP_CD4,'') AS GRP_CD4,");
		sql.append(" NVL(CST_CALLING,'') AS CST_CALLING,");
		sql.append(" NVL(SLS_DEST,'') AS SLS_DEST,");
		sql.append(" NVL(CORP_CD,'') AS CORP_CD,");
		sql.append(" NVL(CDR_CD,'') AS CDR_CD,");
		sql.append(" NVL(OLD_CUS_CD1,'') AS OLD_CUS_CD1,");
		sql.append(" NVL(OLD_CUS_CD2,'') AS OLD_CUS_CD2,");
		sql.append(" NVL(OLD_CUS_CD3,'') AS OLD_CUS_CD3,");
		sql.append(" NVL(TRD_STP_FLG,'') AS TRD_STP_FLG,");
		sql.append(" NVL(RECPT_TYP,'') AS RECPT_TYP,");
		sql.append(" NVL(STR_ORG_CD,'') AS STR_ORG_CD,");
		sql.append(" NVL(BU_AREA_CD,'') AS BU_AREA_CD,");
		sql.append(" NVL(CORP_CD_SLS,'') AS CORP_CD_SLS,");
		sql.append(" NVL(PRIZ_RT_CD,'') AS PRIZ_RT_CD,");
		sql.append(" NVL(RMK,'') AS RMK,");
		sql.append(" NVL(PMIT_CLNT_CD,'') AS PMIT_CLNT_CD,");
		sql.append(" NVL(DFLT_SHP_DSTN_CD,'') AS DFLT_SHP_DSTN_CD,");
		sql.append(" NVL(DSP_ITM_CLNT_TYP,'') AS DSP_ITM_CLNT_TYP,");
		sql.append(" NVL(CNSMT_ITM_CLNT_TYP,'') AS CNSMT_ITM_CLNT_TYP,");
		sql.append(" NVL(FRNT_WHRS_CD,'') AS FRNT_WHRS_CD,");
		sql.append(" NVL(BIL_DSTN_CD,'') AS BIL_DSTN_CD,");
		sql.append(" NVL(CUS_PYMT_PRID,'') AS CUS_PYMT_PRID,");
		sql.append(" NVL(CUS_BNK_CD,'') AS CUS_BNK_CD,");
		sql.append(" NVL(CUS_BNK_ACC,'') AS CUS_BNK_ACC,");
		sql.append(" NVL(CUS_CRDT_LMT_AMT,'') AS CUS_CRDT_LMT_AMT,");
		sql.append(" NVL(CUS_ADD_PRIZ_TAX_CD,'') AS CUS_ADD_PRIZ_TAX_CD,");
		sql.append(" NVL(CUS_ADD_PRIZ_CAL_TYP,'') AS CUS_ADD_PRIZ_CAL_TYP,");
		sql.append(" NVL(CUS_ADD_PRIZ_RGS_NO,'') AS CUS_ADD_PRIZ_RGS_NO,");
		sql.append(" NVL(CUS_MLT_CRCY,'') AS CUS_MLT_CRCY,");
		sql.append(" NVL(CUS_CRCY_CD,'') AS CUS_CRCY_CD,");
		sql.append(" NVL(CUS_AR_AC,'') AS CUS_AR_AC,");
		sql.append(" NVL(CUS_PRFT_AC,'') AS CUS_PRFT_AC,");
		sql.append(" NVL(CUS_TAX_AC,'') AS CUS_TAX_AC,");
		sql.append(" NVL(SUP_DEBT_AC,'') AS SUP_DEBT_AC,");
		sql.append(" NVL(DFLT_RCV_DSTN_CD,'')AS DFLT_RCV_DSTN_CD,");
		sql.append(" NVL(SITE_NM,'') AS SITE_NM,");
		sql.append(" NVL(SUP_PRPY_AC,'') AS SUP_PRPY_AC,");
		sql.append(" NVL(SUP_PRPYFT_AC,'') AS SUP_PRPYFT_AC,");
		sql.append(" NVL(SUP_PYMT_PRID,'') AS SUP_PYMT_PRID,");
		sql.append(" NVL(OVS_SUP_TYP,'') AS OVS_SUP_TYP,");
		sql.append(" NVL(MAIN_STR_TYP,'') AS MAIN_STR_TYP,");
		sql.append(" NVL(CONS_AC_TYP,'') AS CONS_AC_TYP,");
		sql.append(" NVL(FM_TYP,'') AS FM_TYP,");
		sql.append(" NVL(SUP_ADD_PRIZ_TAX_CD,'') AS SUP_ADD_PRIZ_TAX_CD,");
		sql.append(" NVL(CUS_PRC_TAB_CD,'') AS CUS_PRC_TAB_CD,");
		sql.append(" TO_CHAR(NVL(RGS_DTTM,''),'YYYYMMDD HH24:MI:SS') AS RGS_DTTM,");
		sql.append(" NVL(RGS_CHRG_CD,'') AS RGS_CHRG_CD,");
		sql.append(" NVL(RGS_PGID,'') AS RGS_PGID,");
		sql.append(" TO_CHAR(NVL(UPD_DTTM,''),'YYYYMMDD HH24:MI:SS') AS UPD_DTTM,");
		sql.append(" NVL(UPD_CHRG_CD,'') AS UPD_CHRG_CD,");
		sql.append(" NVL(UPD_PGID,'') AS UPD_PGID");
		sql.append(" FROM");
		sql.append(" M01");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_M0106(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT");
		sql.append(" TRPT_NM_CN");
		sql.append(" FROM");
		sql.append(" M01");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT <"+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" APL_EDT >"+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("FM_TYP_6")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_M1507(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT");
		sql.append(" WHRS_NM_CN");
		sql.append(" FROM");
		sql.append(" M15");
		sql.append(" WHERE");
		sql.append(" CTRL_DVSN_CD "+((getString("CTRL_DVSN_CD").equals(""))?" is null ":"=")+getString("CTRL_DVSN_CD")+"");
		sql.append(" AND");
		sql.append(" WHRS_CD "+((getString("WHRS_CD").equals(""))?" is null ":"=")+getString("WHRS_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT <"+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" APL_EDT >"+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("FM_TYP_X")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_M1901(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("	SELECT ");
		sql.append("	NVL(CHRG_NM_CN,'') AS CHRG_NM_CN ");
		sql.append("	FROM ");
		sql.append("	M19 ");
		sql.append("	WHERE  ");
		sql.append("	CHRG_CD "+((getString("CHRG_CD").equals(""))?" is null ":"=")+getString("CHRG_CD")+" ");
		sql.append("	AND");
		sql.append("	FM_TYP <> "+getString("FM_TYP_6")+"");
		sql.append("	AND");
		sql.append("	FM_TYP <> "+getString("FM_TYP_9")+" ");
		sql.append("	");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}

	public SelectResultRset SELECT_M0107(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT");
		sql.append(" TRPT_NM_CN");
		sql.append(" FROM");
		sql.append(" M01");
		sql.append(" WHERE");
		sql.append(" VDR_CD "+((getString("VDR_CD").equals(""))?" is null ":"=")+getString("VDR_CD")+"");
		sql.append(" AND");
		sql.append(" APL_BDT <"+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" APL_EDT >"+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		sql.append(" AND");
		sql.append(" FM_TYP <> "+getString("FM_TYP_6")+"");
		sql.append(" AND");
		sql.append(" TRPT_CLSS_D_TYP "+((getString("TRPT_CLSS_D_TYP").equals(""))?" is null ":"=")+getString("TRPT_CLSS_D_TYP")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}


	public void setVDR_CD(String value){
		if(value==null) {
			paramsString.remove("VDR_CD");
			return;
		}
		paramsString.put("VDR_CD",value);
	}


	public void setAPL_BDT(String value){
		if(value==null) {
			paramsString.remove("APL_BDT");
			return;
		}
		paramsString.put("APL_BDT",value);
	}


	public void setNOWDATE(String value){
		if(value==null) {
			paramsString.remove("NOWDATE");
			return;
		}
		paramsString.put("NOWDATE",value);
	}


	public void setFM_TYP(String value){
		if(value==null) {
			paramsString.remove("FM_TYP");
			return;
		}
		paramsString.put("FM_TYP",value);
	}


	public void setAPL_EDT(String value){
		if(value==null) {
			paramsString.remove("APL_EDT");
			return;
		}
		paramsString.put("APL_EDT",value);
	}


	public void setUPD_DTTM(String value){
		if(value==null) {
			paramsString.remove("UPD_DTTM");
			return;
		}
		paramsString.put("UPD_DTTM",value);
	}


	public void setUPD_CHRG_CD(String value){
		if(value==null) {
			paramsString.remove("UPD_CHRG_CD");
			return;
		}
		paramsString.put("UPD_CHRG_CD",value);
	}


	public void setUPD_PGID(String value){
		if(value==null) {
			paramsString.remove("UPD_PGID");
			return;
		}
		paramsString.put("UPD_PGID",value);
	}


	public void setSYSDATE(String value){
		if(value==null) {
			paramsString.remove("SYSDATE");
			return;
		}
		paramsString.put("SYSDATE",value);
	}


	public void setFM_TYP_6(String value){
		if(value==null) {
			paramsString.remove("FM_TYP_6");
			return;
		}
		paramsString.put("FM_TYP_6",value);
	}


	public void setCTRL_DVSN_CD(String value){
		if(value==null) {
			paramsString.remove("CTRL_DVSN_CD");
			return;
		}
		paramsString.put("CTRL_DVSN_CD",value);
	}


	public void setWHRS_CD(String value){
		if(value==null) {
			paramsString.remove("WHRS_CD");
			return;
		}
		paramsString.put("WHRS_CD",value);
	}


	public void setFM_TYP_X(String value){
		if(value==null) {
			paramsString.remove("FM_TYP_X");
			return;
		}
		paramsString.put("FM_TYP_X",value);
	}


	public void setCHRG_CD(String value){
		if(value==null) {
			paramsString.remove("CHRG_CD");
			return;
		}
		paramsString.put("CHRG_CD",value);
	}


	public void setFM_TYP_9(String value){
		if(value==null) {
			paramsString.remove("FM_TYP_9");
			return;
		}
		paramsString.put("FM_TYP_9",value);
	}


	public void setTRPT_CLSS_D_TYP(String value){
		if(value==null) {
			paramsString.remove("TRPT_CLSS_D_TYP");
			return;
		}
		paramsString.put("TRPT_CLSS_D_TYP",value);
	}


}
